using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using System.Drawing;


namespace SampleDockingApp
{
    public partial class MDIParent : Form
    {
        public MDIParent() : this(new DockContentFormFactory())
        {
        }

        public MDIParent(IDockContentFormFactory dockContentFactory)
        {
            InitializeComponent();

            DockPanel dockPanel = new DockPanel();
            dockPanel.Dock = DockStyle.Fill;
            dockPanel.BackColor = Color.Beige;
            Controls.Add(dockPanel);
            dockPanel.BringToFront();

            DockContent content1 = dockContentFactory.Create("Content 1", DockState.Document, Color.SteelBlue);
            content1.Show(dockPanel);

            DockContent content2 = dockContentFactory.Create("Content 2", DockState.DockRight, Color.DarkSeaGreen);
            content2.Show(dockPanel);

            DockContent content3 = dockContentFactory.Create("Content 3", DockState.Float, Color.PaleGoldenrod);
            content3.Show(dockPanel);
            content3.DockHandler.FloatPane.DockTo(dockPanel.DockWindows[DockState.DockRight]);
        }
    }
}
